import { createRouter, createWebHistory } from 'vue-router';
import Login from './components/login.vue';
import MemberLayout from './components/MemberLayout.vue';
import AdminLayout from './components/AdminLayout.vue';

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: Login, // 登录页面
  },
  {
    path: '/member',
    name: 'MemberLayout',
    component: MemberLayout, // 成员页面
  },
  {
    path: '/admin',
    name: 'AdminLayout',
    component: AdminLayout, // 管理员页面
  },
  {
    path: '/',
    redirect: '/login', // 默认跳转到登录页面
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
